package SpringBoot.PrintBeanDefinitionNames;

import java.util.Arrays;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {
	public static void main(String[] args) {
		SpringApplication app = new SpringApplication(Application.class);
		app.setBannerMode(Banner.Mode.OFF);
		ConfigurableApplicationContext context = app.run(args);
		
        String[] names = context.getBeanDefinitionNames();
        Arrays.sort(names);
        for (String name : names) {
        	Object bean = context.getBean(name);
        	if(bean.getClass().getName().startsWith("zzz.")) {
                System.err.println(name + "\t\t\t" + bean.getClass());
        	} else {
        		System.err.println(name + "\t\t\t" + bean.getClass());
        	}
        }
	}
}
